<!--
  @created by zhangpeng18 on 2019-8-6 14:04:58
  @updated by
  @description webService驱动管理
-->
<div>
	<yu-panel title="webService驱动管理">
		<yu-row :gutter="24">
			<yu-col :span="5">
				<yu-xtree ref="refTree" :height="height - 20" @node-click="nodeClickFn" :data-url="treeDataUrl" data-id="appCode" data-label="appName"
				 data-pid="parentId" :data-async="async" :data-params="param" data-root="0000" style="margin:10px 10px 0 0;" icon="iconPath">
				</yu-xtree>
			</yu-col>
			<yu-col :span="19">
				<yu-xform related-table-name="refTable" form-type="search" v-model="searchFormdata">
					<yu-xform-group :column="4">
						<yu-xform-item label="驱动名称" placeholder="驱动名称" ctype="input" name="className"></yu-xform-item>
					</yu-xform-group>
				</yu-xform>
				<yu-toolBar>
					<yu-button @click="addFn" v-if="nodeLeaf&&addFnButton">新增</yu-button>
					<yu-button @click="modifyFn" v-if="updateFnButton">修改</yu-button>
					<yu-button @click="deleteFn" v-if="deleteFnButton">删除</yu-button>
				</yu-toolBar>
				<yu-xtable ref="refTable" row-number :data-url="dataUrl" :pageable="false" selection-type="radio">
					<yu-xtable-column label="系统缩写" prop="appCode" sortable v-if="appCodeShow"></yu-xtable-column>
					<yu-xtable-column label="驱动名称" prop="className">
						<template slot-scope="scope">
							<a style="text-decoration:underline;color:#636CE4 " href="javascipt:void(0);" @click="viewFn(scope.row)">{{ scope.row.className }}</a>
						</template>
					</yu-xtable-column>
					<yu-xtable-column label="服务器地址和端口号" prop="server"></yu-xtable-column>
					<yu-xtable-column label="服务路径名" prop="serviceName"></yu-xtable-column>
					<yu-xtable-column label="服务命名空间" prop="nameSpace"></yu-xtable-column>
					<yu-xtable-column label="组包或函数名" prop="packages"></yu-xtable-column>
				</yu-xtable>
				<yu-xdialog :title="viewTitle" :visible.sync="dialogVisible" width="900px">
					<yu-xform label-width="160px" ref="refForm" v-model="formdata" :disabled="formDisabled">
						<yu-xform-group>
							<yu-xform-item label="驱动缩写" ctype="input" name="classCode" :disabled="isReadOnly" @blur="checkClassCode"></yu-xform-item>
							<yu-xform-item label="驱动名称" ctype="input" name="className" rules="required"></yu-xform-item>
							<yu-xform-item label="对应代理标识" ctype="select" name="agentId" :options="agentIds" rules="required"></yu-xform-item>
							<yu-xform-item label="字符编码" ctype="input" name="encode" rules="required"></yu-xform-item>
							<yu-xform-item label="服务地址和端口号" ctype="input" name="server" :rules="rule[2]"></yu-xform-item>
							<yu-xform-item label="服务路径名" ctype="input" name="serviceName" rules="required"></yu-xform-item>
							<yu-xform-item label="服务命名空间" ctype="input" name="nameSpace" rules="required"></yu-xform-item>
							<yu-xform-item label="组包或函数名" ctype="input" name="packages"></yu-xform-item>
							<yu-xform-item label="字符串名称" ctype="input" name="stringName"></yu-xform-item>
							<yu-xform-item label="状态参数名" ctype="input" name="status"></yu-xform-item>
							<yu-xform-item label="成功状态值" ctype="input" name="succValue"></yu-xform-item>
							<yu-xform-item label="返回码参数名" ctype="input" name="returnCode" :rules="rule[0]"></yu-xform-item>
							<yu-xform-item label="服务错误参数名" ctype="input" name="errorMsg"></yu-xform-item>
							<yu-xform-item label="出错返回值" ctype="input" name="errorReturn" value="2"></yu-xform-item>
						</yu-xform-group>
					</yu-xform>
					<yu-toolBar>
						<yu-button @click="propAddFn">新增</yu-button>
						<yu-button @click="propDeleteFN">删除</yu-button>
					</yu-toolBar>
					<yu-xtable ref="refPropTable" row-number selection-type="checkbox" :pageable="false" :data="propTableData">
						<yu-xtable-column label="参数代码" prop="paramCode" ctype="input" :rules="rule[1]"></yu-xtable-column>
						<yu-xtable-column label="参数名称" prop="paramName" ctype="input" rules="required"></yu-xtable-column>
						<yu-xtable-column label="参数值" prop="paramValue" ctype="yufp-select-params" :params="nodeTemp" rules="required" @select-fn="getSelectedData"></yu-xtable-column>
					</yu-xtable>
					<div class="yu-grpButton">
						<yu-button v-show="cancelBtnShow" @click="cancelFn">取消</yu-button>
						<yu-button v-show="saveBtnShow" type="primary" v-if="!saveDisabled" @click="saveFn" :disabled="saveDisabled">保存</yu-button>
						<yu-button v-show="saveBtnShow" type="info" v-if="saveDisabled" @click="saveFn" :disabled="saveDisabled">保存</yu-button>
					</div>
				</yu-xdialog>
			</yu-col>
		</yu-row>
	</yu-panel>
</div>